#include <iostream>
#include <string>
#include <algorithm>


using namespace std;
/*
string s1;
int main() {
    getline(cin, s1);
    reverse(s1.begin(), s1.end());
    auto start = s1.begin();
    while (start != s1.end())
    {
        auto end = start;
        while (end != s1.end() && *end != ' ')
            end++;
        reverse(start, end);
        if (end == s1.end())
            start = end;
        else
            start = end + 1;
    }
    cout << s1;

}*/


